package io.github.wslxm.springbootplus2.core.utils.tree;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.LinkedList;
import java.util.List;

/**
 * tree 工具类 父对象
 *
 * @author wangsong
 * @version 1.0.0
 * @mail 1720696548@qq.com
 * @date 2022/11/21 0021 9:25
 */
@Data
public class BaseTree<T, S> {

    @Schema(description = "id")
    private S id;

    @Schema(description = "父节点id")
    private S pid;

    @Schema(title = "父节点 tree", description = " 从子级 .fatherNode 获取父级 .fatherNode.fatherNode 获取父级的父级 (默认没有数据, 后端处理后存在数据)")
    private T fatherNode;

    @Schema(title = "父节点 list", description = " 按父级到子级节点顺序存放 (默认没有数据, 后端处理后存在数据)")
    private LinkedList<T> fathers;

    @Schema(description = "节点名称")
    private String name;

    @Schema(description = "下级节点")
    private List<T> children;

}
